package io.renren.controller;

import io.renren.common.utils.R;
import io.renren.service.RoomEslService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 会议室价签
 *
 * @author 1
 * @email 1@2.com
 * @date 2021-11-19 11:03:23
 */
@RestController
@RequestMapping("/roomesl")
public class RoomEslController {
    @Autowired
    private RoomEslService roomEslService;

    /**
     * 列表
     */
    @RequestMapping("/countNamePlate")
    public R count(@RequestParam Map<String, Object> map) {
        int count = 0;
        String roomId = (String) map.get("roomId");
        if (StringUtils.isNotBlank(roomId)) {

            count = roomEslService.countByRoomIdAndType(Long.valueOf(roomId), "namePlate");
        }

        return R.ok().put("count", count / 2);
    }


}
